package com.yaowk.service.mall.clothing.entity;

import com.yaowk.service.common.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import java.math.BigDecimal;
import java.util.Set;

/**
 * 会员等级
 */
@Getter
@Setter
@ToString
@Entity
@DynamicUpdate
@DynamicInsert
public class CmMemberLevel extends BaseEntity<Integer> {

    private Integer level;
    private String name;
    private BigDecimal condition;
    private BigDecimal discount;
    private Byte status;
    @ColumnDefault("1")
    private Byte updatable;

    @OneToMany(mappedBy = "memberLevel")
    private Set<CmMember> members;
}
